const fs = require('fs')

function httpReadFile(path, response) {
    fs.readFile(path, (error,data) => {
        if (error) {
        // response.setHeader('Content-Type',"text/plain;chartset=UTF-8")
            response.write('请求出错');
            response.end(error);
        } else {
            response.end(data)
        }

    })
}


// 模板

module.exports = {
    httpReadFile,
}